#ifndef __AP_VIDEO_RECORD_H__
#define __AP_VIDEO_RECORD_H__

#define VIDEO_RECORD_CYCLE_TIME_INTERVAL	(128 * 60)	//128 = 1s
#define VIDEO_RECORD_CYCLE_TIME_PRE_OPEN	(64)		// 64 = 0.5s

// Motion detection
#define MOTION_DETECT_CHECK_TIME_INTERVAL	(128)

// when MOTION_DETECT_STOP_TIME seconds detect no motion then stop video record
#define MOTION_DETECT_STOP_TIME						(10)

typedef struct
{
   INT8S (*ap_video_record_init_ptr)(void);
   void (*ap_video_record_exit_ptr)(void);
   void (*ap_video_record_md_icon_clear_all_ptr)(void);
  void (*ap_video_record_md_tick_ptr)(INT8U *md_tick);
} Overlap_Record_Function;



extern INT8S	ap_video_record_init(void);
extern INT8S	ap_video_record_init_TP(void);
extern void		ap_video_record_exit(void);
extern void		ap_video_record_exit_TP(void);
extern INT8S	ap_video_record_func_key_active(void);
extern void		ap_video_record_start(void);
extern void		ap_video_record_sts_set(INT8S sts);
extern INT8U	ap_video_record_sts_get(void);
extern void		ap_video_record_reply_action(STOR_SERV_FILEINFO *file_info_ptr);

extern void		ap_video_record_lock_current_file(void);

extern void		video_calculate_left_recording_time_enable(void);
extern void		video_calculate_left_recording_time_disable(void);

extern void		ap_video_record_clear_park_mode(void);
extern void		ap_video_record_show_park_mode(void);
extern void		ap_video_record_clear_resolution_str(void);
extern void		ap_video_record_resolution_display(void);

#if C_MOTION_DETECTION == CUSTOM_ON
extern void		ap_video_record_md_icon_clear_all(void);
extern void		ap_video_record_md_icon_clear_all_TP(void);
extern void		ap_video_record_md_icon_update(INT8U sts);
extern void		ap_video_record_md_tick(INT8U *md_tick);
extern void		ap_video_record_md_tick_TP(INT8U *md_tick);
extern INT8S	ap_video_record_md_active(INT8U *md_tick);
extern void		ap_video_record_md_disable(void);
#endif
#if C_CYCLIC_VIDEO_RECORD == CUSTOM_ON
extern void		ap_video_record_cycle_reply_open(STOR_SERV_FILEINFO *file_info_ptr);
extern void		ap_video_record_cycle_reply_action(STOR_SERV_FILEINFO *file_info_ptr);
#endif
extern void		overlap_record_function_initial(void);

#endif // __AP_VIDEO_RECORD_H__
